home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 6
/
CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso
/
cucd
/
prog
/
mui
/
muibuilder
/
mb
/
tools
/
bumprev.rexx
next >
Wrap
OS/2 REXX Batch file
|
1994-09-19
|
2KB
|
86 lines
/*
* $VER: BumpRev.rexx 1.0 (26.07.94) © Sylvain Rougier
*
*
* Example:
* 1> rx bumprev.rexx Name prog Version 1 Revision 0 Copyright "© by Sylvain Rougier" IncRev Verbose
*
*/
PARSE ARG ArgLine
call addlib("RexxDosSupport.library",0,-30,2)
Template = "Name/A,Version,Revision,File/K,Copyright/K,IncRev/K/S,Verbose/K/S,Asm/K/S"
IF ~ReadArgs(ArgLine, Template, "Args.") THEN DO
Echo "BumpRev: " Fault(RC)
Echo "Usage: "Template
EXIT
END
IF Args.File = 'ARGS.FILE' THEN
FileName = Args.Name"_rev.h"
ELSE
FileName = Args.File
IF Args.IncRev THEN DO
IF OPEN(FH, FileName, 'R') THEN DO
s = ReadLn(FH) /* VERSION */
OldVersion = WORD(s, 3)
IF OldVersion ~= Args.Version THEN
Args.Revision = 0
ELSE
DO
s = ReadLn(FH) /* REVISION */
Args.Revision = WORD(s, 3) + 1
END
CLOSE(FH)
END
ELSE
Args.Revision = 0;
END
VersionRevision = Args.Version'.'Args.Revision
DateVer = SUBSTR(DATE(SORTED), 7, 2)'.'SUBSTR(DATE(SORTED), 5, 2)'.'SUBSTR(DATE(SORTED), 3, 2)
VersTag = '$VER:'Args.Name' 'VersionRevision' ('DateVer')"'
IF OPEN(FH, FileName, 'W') THEN DO
WriteLn(FH, '#define VERSION 'Args.Version)
WriteLn(FH, '#define REVISION 'Args.Revision)
WriteLn(FH, '#define VERSIONREVISION "'VersionRevision'"') /* asked by Pierre Carrette */
WriteLn(FH, '#define DATE 'DateVer)
WriteLn(FH, '#define VERS "'Args.Name' 'VersionRevision'"')
WriteLn(FH, '#define VSTRING "'Args.Name' 'VersionRevision' ('DateVer')\r\n"')
WriteLn(FH, '#define VERSTAG "'VersTag)
CLOSE(FH)
END
ELSE
EXIT
IF Args.Asm THEN DO
IF OPEN(FH, Args.Name"_rev.i", 'W') THEN DO
WriteLn(FH, "VERSION EQU "Args.Version)
WriteLn(FH, "REVISION EQU "Args.Revision)
WriteLn(FH, "DATE MACRO")
WriteLn(FH, " dc.b '"DateVer"'")
WriteLn(FH, " ENDM")
WriteLn(FH, "VERS MACRO")
WriteLn(FH, " dc.b '"Args.Name" "VersionRevision"'")
WriteLn(FH, " ENDM")
WriteLn(FH, "VSTRING MACRO")
WriteLn(FH, " dc.b '"Args.Name" "VersionRevision" ("DateVer")',13,10,0")
WriteLn(FH, " ENDM")
WriteLn(FH, "VERSTAG MACRO")
WriteLn(FH, " dc.b '$VER: "Args.Name" "VersionRevision" ("DateVer") "TIME(NORMAL)" "Args.Copyright"',0")
WriteLn(FH, " ENDM")
CLOSE(FH)
END
ELSE
EXIT
END
IF Args.Verbose THEN DO
Echo VersTag
END